#ifndef __BMP_DECODE_H__
#define __BMP_DECODE_H__

#include "lib_config.h"

#pragma pack(1)
struct bitmap_fileheader{
	uint16_t bfType;
	uint32_t bfSize;
	uint16_t bfReserved1;
	uint16_t bfReserved2;
	uint32_t bfOffBits;
};

struct bitmap_infoheader{
	uint32_t biSize;
	uint32_t biWidth;
	uint32_t biHeight;
	uint16_t biPlanes;
	uint16_t biBitCount;
	uint32_t biCompression;
	uint32_t biSizeImages;
	uint32_t biXPelsPerMeter;
	uint32_t biYPelsPerMeter;
	uint32_t biClrUsed;
	uint32_t biClrImportant;
};

struct bmp_format{
	struct bitmap_fileheader fileheader;
	struct bitmap_infoheader infoheader;
	unsigned char *ptr;
};

#pragma pack()

struct filemap{
#if (0x01 == LINUX_OS)
	FILE *tfp;
#endif
	int ifilesize;
	unsigned char *pufilemapmem;
};

struct pixeldata{
	int iwidth;
	int iheigh;
	int ibpp;
	int ilinebytes;
	int itotalbytes;
	unsigned char *paupixeldata;
};

struct bmp_decode{
	bool (*is_support)(struct filemap *ptfile);
	int (*getpixeldata)(struct filemap *ptfile,struct pixeldata *ptdata);
	void (*freepixeldata)(struct pixeldata *ptdata);
};

extern struct bmp_decode *get_decoder(void);


#endif
//__BMP_DECODE_H__

